<admintpl file="header" />
<body class="J_scroll_fixed">
	<div class="wrap J_check_wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="javascript:;">所有人员</a></li>
			<li><a href="{:U('AdminEmployee/add',array('term'=>empty($term['term_id'])?'':$term['term_id']))}" target="_self">添加人员</a></li>
		</ul>
		<form class="well form-search" method="post" action="{:U('AdminEmployee/index')}">
			<div class="search_type cc mb10">
				<div class="mb10">
					<span class="mr20">分类： 
						<select class="select_2" name="term">
							<option value='0'>全部</option>{$taxonomys}
						</select> &nbsp;&nbsp;
						时间：
						<input type="text" name="start_time" class="J_date" value="{$formget.start_time|default=''}" style="width: 80px;" autocomplete="off">-
						<input type="text" class="J_date" name="end_time" value="{$formget.end_time|default=''}" style="width: 80px;" autocomplete="off"> &nbsp; &nbsp;
						姓名： 
						<input type="text" name="keyword" style="width: 200px;" value="{$formget.keyword|default=''}" placeholder="请输入关键字...">
						<input type="submit" class="btn btn-primary" value="搜索" />
					</span>
				</div>
			</div>
		</form>
		<form class="J_ajaxForm" action="" method="post">
			<div class="table-actions">
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:U('AdminEmployee/listorders')}">排序</button>
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:U('AdminEmployee/check',array('check'=>1))}" data-subcheck="true">审核</button>
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:U('AdminEmployee/check',array('uncheck'=>1))}" data-subcheck="true">取消审核</button>
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:U('AdminEmployee/top',array('top'=>1))}" data-subcheck="true">置顶</button>
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:U('AdminEmployee/top',array('untop'=>1))}" data-subcheck="true">取消置顶</button>
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:U('AdminEmployee/recommend',array('recommend'=>1))}" data-subcheck="true">推荐</button>
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:U('AdminEmployee/recommend',array('unrecommend'=>1))}" data-subcheck="true">取消推荐</button>
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:U('AdminEmployee/delete')}" data-subcheck="true" data-msg="你确定删除吗？">删除</button>
				<button class="btn btn-primary btn-small J_articles_move" type="button">批量移动</button>
			</div>
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="15"><label><input type="checkbox" class="J_check_all" data-direction="x" data-checklist="J_check_x"></label>{$vo.eid}</th>
						
						<th width="50">姓名</th>
						<th width="50">服务项目</th>
						<th width="90">地址</th>
						<th width="50">身份证号</th>
						<th width="50">出生年月</th>
						<th width="50">联系电话</th>
						<th width="50">性别</th>
						<th width="50">缩略图</th>
						<th width="80">技能</th>
						<th width="20">学历</th>
						<th width="50">状态</th>
						<th width="60">操作</th>
					</tr>
				</thead>
				<php>
				$status=array("1"=>"审","0"=>"");
				$top_status=array("1"=>"顶","0"=>"");
				$recommend_status=array("1"=>"荐","0"=>"");
                $xueli=C('XUELI');
				</php>
				<foreach name="posts" item="vo">
				<tr>
					<td><input type="checkbox" class="J_check" data-yid="J_check_y" data-xid="J_check_x" name="ids[]" value="{$vo.eid}" title="ID:{$vo.eid}"></td>
					
					<td><a href="{:U('jiazheng/employee/index',array('eid'=>$vo['eid']))}" target="_blank"> <span>{$vo.ename}</span></a></td>
					<td>{$terms[$vo['term_id']]}</td>
					<td>{$vo.address}</td>
					<td><a href="javascript:open_iframe_dialog('{:U('comment/commentadmin/index',array('post_id'=>$vo['uid']))}','评论列表')">{$vo.idcard}</a></td>
					<td>{$vo['birth']}</td>
					<td>{$vo['ephone']}</td>
					<td>{$vo['sex']?"男":"女"}</td>
					<td>
						<php>$smeta=json_decode($vo['smeta'],true);</php>
						<if condition="!empty($smeta['thumb'])">
							<a href="{:sp_get_asset_upload_path($smeta['thumb'])}" target='_blank'>查看</a>
						</if>
					</td>
					<td>{$vo.eskill}</td>
					<td>{$xueli[$vo['edu']-1]['value']}</td>
					<td>{$status[$vo['status']]}-{$top_status[$vo['istop']]}-{$recommend_status[$vo['recommended']]}
					</td>
					<td>
						<a href="{:U('AdminEmployee/restore',array('term'=>empty($term['term_id'])?'':$term['term_id'],'eid'=>$vo['eid']))}" class="J_ajax_dialog_btn" data-msg="确定还原吗？">还原</a>| 
						<a href="{:U('AdminEmployee/clean',array('term'=>empty($term['term_id'])?'':$term['term_id'],'eid'=>$vo['eid'],'id'=>$vo['eid']))}" class="J_ajax_del">删除</a>
                    </td>
				</tr>
				</foreach>
			
			</table>
			<div class="table-actions">
				
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:u('AdminEmployee/clean')}" data-subcheck="true" data-msg="你确定删除吗？">删除</button>
				
			</div>
			<div class="pagination">{$Page}</div>

		</form>
	</div>
	<script src="__ROOT__/statics/js/common.js"></script>
	<script>
		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location = "{:U('AdminEmployee/index',$formget)}";
			}
		}
		setInterval(function() {
			refersh_window();
		}, 2000);
		$(function() {
			setCookie("refersh_time", 0);
			Wind.use('ajaxForm', 'artDialog', 'iframeTools', function() {
				//批量移动
				$('.J_articles_move').click(
						function(e) {
							var str = 0;
							var id = tag = '';
							$("input[name='ids[]']").each(function() {
								if ($(this).attr('checked')) {
									str = 1;
									id += tag + $(this).val();
									tag = ',';
								}
							});
							if (str == 0) {
								art.dialog.through({
									id : 'error',
									icon : 'error',
									content : '您没有勾选信息，无法进行操作！',
									cancelVal : '关闭',
									cancel : true
								});
								return false;
							}
							var $this = $(this);
							art.dialog.open(
									"__ROOT__/index.php?g=portal&m=AdminPost&a=move&ids="
											+ id, {
										title : "批量移动",
										width : "80%"
									});
						});
			});
		});
	</script>
</body>
</html>